#include <iostream>
#include <string>
using namespace std;

class Building
{
    // goodGay全局函数 是 Building 类的好朋友，可以访问Building中的私有成员
    // 友元无法被继承
    friend void goodGay(Building& building);
    
public:
    Building()
    {
        livingRoom = "客厅";
        bedRoom = "卧室";
    }

public:
    string livingRoom;//客厅

private:
    string bedRoom;//卧室
};

//全局函数
void goodGay(Building& building)
{
    cout << "好基友全局函数 正在访问：" << building.livingRoom << endl;

    cout << "好基友全局函数 正在访问：" << building.bedRoom << endl;
}

void test1()
{
    Building building;
    goodGay(building);
}

int main()
{
    test1();
    return 0;
}